package core;

import dataStructures.MyQuery;
import twitter4j.*;

public class BasicSearch {
		 public static void main(String[] args) {
		     Twitter twitter = new TwitterFactory().getInstance("przyjacielgej", "rahimqwe");
		     System.out.println(twitter);
		  try {
		   Query query = new Query("obama");
		   query.setGeoCode(new GeoLocation(10.2, 50.2), 1111.1, Query.KILOMETERS);
		   new MyQuery(query);
		   QueryResult result = twitter.search(query);
		   
		      for (Tweet tweet : result.getTweets()) {
		          System.out.println(
		            tweet.getCreatedAt() + 
		            " user: " + tweet.getFromUser().substring(0, 2) +
		            " text: " + tweet.getText().substring(0, 2) +
		            " loc: " + tweet.getGeoLocation()
		          );
		      }
		      
		  } catch (TwitterException e) {
		   e.printStackTrace();
		  }
		 }
		}